package cn.edu.hunau.java.week01.day03;

import org.junit.Test;

public class ArrTest {
    @Test
    public void testArray() {
        int[] arr = {24, 34, 35, 58, 83, 94};
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
            System.out.println(sum);
        }
        }
        public int arraySum(int[] arr) {
            int sum = 0;
            for (int i = 0; i < arr.length; i++) {
                sum += arr[i];
            }
            return sum;
        }
}
